package com.fesine.netapply.service.impl;

import com.fesine.netapply.dao.UserDao;
import com.fesine.netapply.service.UserService;
import com.fesine.netapply.vo.PageBean;
import com.fesine.netapply.vo.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Resource
    private UserDao userDao;

    public User login(User user) {
        return this.userDao.login(user);
    }

    public void add(User user) {
        this.userDao.add(user);
    }

    public void update(User user) {
        this.userDao.update(user);
    }

    public void delete(int id) {
        this.userDao.delete(id);
    }

    public List<User> find(PageBean pageBean, User user) {
        return this.userDao.find(pageBean, user);
    }

    @Override
    public List<User> find() {
        return find(null,null);
    }

    public int count(User user) {
        return this.userDao.count(user);
    }

    public User loadById(int id) {
        return this.userDao.loadById(id);
    }

}
